home *** CD-ROM | disk | FTP | other *** search
- Object.MediaPlayerClass = function()
- {
- var s = "@";
- this.filmDiv = "filmuletzDIV";
- if(this.behaviour == 1)
- {
- this.cMovie = 0;
- }
- else
- {
- this.cMarker = "";
- this.watch("cMarker",function(id, o, n)
- {
- this.cMarker = n;
- this.setCMarker();
- }
- );
- }
- this.mEnded = 0;
- this.fromMarker = undefined;
- this.end = 0;
- this.watch("mEnded",function(id, o, n)
- {
- this.mEnded = n;
- this.setMEnded();
- }
- );
- this.onLoad = function()
- {
- this.loadRadioBtn();
- this.cMarker = 0;
- this.continuous = false;
- this.ply = 0;
- this.playBtn.cntrl = this;
- this.playBtn.onRelease = function()
- {
- if(this.cntrl.ply == 0)
- {
- this.cntrl.playM();
- }
- else
- {
- this.cntrl.pauseM();
- }
- };
- fscommand("register",this.filmDiv + s + this);
- this.update(this.filmDiv,this.films[0],this.x,this.y,this.width,this.height,this.loopM[this.cMovie]);
- this.pauseM();
- };
- };
- Object.MediaPlayerClass.prototype = new MovieClip();
- Object.MediaPlayerClass["extends"](MovieClip);
- Object.MediaPlayerClass.prototype.update = function(div, film, x, y, width, height)
- {
- var s = "@";
- fscommand("load",div + s + film + s + x + s + y + s + width + s + height + s + this.loopM[this.cMovie]);
- if(this.behaviour == 1)
- {
- this._parent.setMv(this.cMovie);
- this.lMovie = this.cMovie;
- this["rd" + this.cMovie].setState(true);
- }
- };
- Object.MediaPlayerClass.prototype.playM = function()
- {
- var s = "@";
- this.ply = 1;
- this.playBtn.gotoAndStop("Play");
- if(this.behaviour == 1 && this.lMovie != this.cMovie)
- {
- this.update(this.filmDiv,this.films[this.cMovie],this.x,this.y,this.width,this.height,this.loopM[this.cMovie]);
- this["rd" + this.cMovie].setState(true);
- }
- if(this.behaviour == 1 && this.end == 1)
- {
- this._parent.mediaPlayerStateIs(2);
- this.end = 0;
- }
- if(this.behaviour == 0 && this.end == 1)
- {
- this.end = 0;
- this.cMarker = 0;
- }
- this._parent.mediaPlayerStateIs(1);
- fscommand("play",this.filmDiv);
- };
- Object.MediaPlayerClass.prototype.pauseM = function()
- {
- var s = "@";
- this.ply = 0;
- this._parent.mediaPlayerStateIs(0);
- this.playBtn.gotoAndStop("Stop");
- fscommand("pause",this.filmDiv);
- };
- Object.MediaPlayerClass.prototype.stopM = function()
- {
- var s = "@";
- this.ply = 0;
- this._parent.mediaPlayerStateIs(0);
- this.playBtn.gotoAndStop("Stop");
- fscommand("stop",this.filmDiv);
- };
- Object.MediaPlayerClass.prototype.loadRadioBtn = function()
- {
- var i = 0;
- while(i < this.moments.length)
- {
- if(this.aBtn == true)
- {
- var mc = this.attachMc("FRadioButtonSymbol","rd" + i,100,i * 25 + 5);
- mc.setLabel(this.moments[i]);
- mc.setData(i);
- mc.setGroupName("radioGroupM");
- }
- else
- {
- this["rd" + i] = this._parent["rd" + i];
- this["rd" + i].setData(i);
- this["rd" + i].setGroupName("radioGroupM");
- }
- i++;
- }
- if(this.aBtn == false)
- {
- this.radioGroupM = this._parent.radioGroupM;
- }
- if(this.behaviour == 0)
- {
- this.radioGroupM.setChangeHandler("setCurrentMarker",this);
- trace(this.radioGroupM.setChangeHandler);
- }
- else
- {
- this.radioGroupM.setChangeHandler("setCurrentMovie",this);
- }
- };
- Object.MediaPlayerClass.prototype.setCurrentMarker = function()
- {
- var s = "@";
- this.end = 0;
- var mk = arguments[0].getData();
- if(undefined == mk)
- {
- mk = arguments[0];
- }
- fscommand("setCurrentMarker",this.filmDiv + s + mk);
- if(mk == 0)
- {
- this.cMarker = 0;
- }
- this.fromMarker = mk;
- this.playM();
- };
- Object.MediaPlayerClass.prototype.setCMarker = function()
- {
- this["rd" + this.cMarker].setState(true);
- this._parent.setMv(this.cMarker);
- if(this.continuous == false)
- {
- this.pauseM();
- }
- };
- Object.MediaPlayerClass.prototype.setCurrentMovie = function()
- {
- var s = "@";
- var mk = arguments[0].getData();
- if(undefined == mk)
- {
- mk = arguments[0];
- }
- this.cMovie = mk;
- this.playM();
- };
- Object.MediaPlayerClass.prototype.setContinuous = function()
- {
- this.continuous = arguments[0].getValue();
- if(this.continuous == true)
- {
- this.playM();
- }
- var i = 0;
- while(i < this.moments.length)
- {
- this["rd" + i].setEnabled(!this.continuous);
- i++;
- }
- };
- Object.MediaPlayerClass.prototype.setMEnded = function(arg)
- {
- this.end = 1;
- if(this.behaviour == 1 && this.cMovie < this.films.length - 1)
- {
- if(this.loopM[this.cMovie] == 1 && this.continuous == false)
- {
- this._parent.mediaPlayerStateIs(2);
- this._parent.mediaPlayerStateIs(1);
- this.end = 0;
- return undefined;
- }
- this.cMovie = this.cMovie + 1;
- if(this.continuous == true)
- {
- this.playM();
- }
- else
- {
- this.pauseM();
- }
- }
- else
- {
- if(this.loopM[this.cMovie] == 1)
- {
- this.end = 0;
- return undefined;
- }
- this.pauseM();
- }
- };
- Object.MediaPlayerClass.prototype.onUnload = function()
- {
- this.stopM();
- fscommand("hide",this.filmDiv);
- };
- Object.registerClass("MediaPlayer",Object.MediaPlayerClass);
-